import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:26554
 * Date:2024-11-03
 * Time:23:01
 */
public class text {
    public static void main(String[] args) {
        int sum = 0;
        Scanner x = new Scanner(System.in);
        int y = x.nextInt();
        for (int i = 1; i <= y; i++) {
            int m = 1;
            for (int j = 1; j <= i; j++) {
                m=m*j;
            }
            sum+=m;
        }
        System.out.println(sum);

    }
}
